var vm_customlog = new Vue({
	el : "#customlog",
	data : {

		loglist : [],//
		logid : '',//
		log : {},//

		//查询用字段
		danweimingcheng : '',
		jigoujibie : '',
		diqu : '',

		pageindex : 1,		// 查询分页初始化页
		pagesize : 10,		// 查询分页初始化页面大小
		pageCount : 0,		// 总页数
		recordCount : 0,	// 总记录数
		targetpage : '', 	// 目标页
	},
	created : function(){
		var _this = this;

		_this.bindLogList();

	},
	watch : {
		//监控分页情况，刷新列表
		pageindex : function(){
			this.bindLogList();
		},

		pagesize : function(){
			//
			this.bindLogList();
		},
	},
	methods : {

		// 根据单位ID查询专家变动申请信息
		bindLogList : function(){
			var _this = this;

			var biandong_layer = layer.open({type:3});
			$.post('/system/log/customloglist', {
				danweimingcheng : _this.danweimingcheng,
				jigoujibie : _this.jigoujibie,
				diqu : _this.diqu,
				pageindex : _this.pageindex,
				pagesize : _this.pagesize,
				rdm : Math.random()
			},function(ppData) {
				layer.close(biandong_layer);

				if (ppData != null) {
					var data = ppData.resultContent;
					_this.loglist = data.loglist;

					var pageInfo = data.PageInfo;
					_this.pageindex = pageInfo.pageIndex;
					_this.pageCount = pageInfo.pageCount;
					_this.recordCount = pageInfo.recordCount;
					_this.targetpage = '';
				}
			},"json");
		},

		clearSearch : function(){
			var _this = this;
			//查询用字段
			_this.danweimingcheng="";
			_this.jigoujibie="";
			_this.diqu="";
		},

		//首页
		firstPage : function(){
			this.pageindex = 1;
		},
		//尾页
		lastPage : function(){
			this.pageindex = this.pageCount;
		},
		//上一页
		prePage : function(){
			var prePage = ((this.pageindex -1) <= 0) ? 1 : (this.pageindex -1);
			this.pageindex = prePage;
		},
		//下一页
		nextPage : function(){
			var nextPage = ((this.pageindex +1) >= this.pageCount) ? this.pageCount : (this.pageindex +1);
			this.pageindex = nextPage;
		},
		//跳到目标页
		targetPage : function() {
			if( this.targetpage != '' && this.targetpage <= this.pageCount && this.targetpage > 0){
				this.pageindex = this.targetpage;
				this.targetpage = '';
			}
		},

	},
})